Repository navigation
Defer execution imports for disabled turn recall - #8774
Conversation
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
cocolord
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=GPT-6; provider=OpenAI; self_reported(当前 host 观察不可用:session_not_bound;不声称精确 backend build)。
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
使用独立 Core 执行普通任务、未启用记忆召回的用户。例如生成并核验一个文件时,召回已关闭,旧入口仍加载召回执行与读权限实现;修复后普通任务完成、恢复和重放保留原结果,这两个实现按实际调用加载。已验证禁用路径少加载两个实现模块,召回状态、完整返回包、权限、单次扣额和重放保持一致。本 PR 只修复召回加载边界,不推广 C1 默认值,也不声称模型收益、延迟收益或完整最小闭包已达标。完整 D2/D5 闭包、真实模型上下文采用、渐进产品控制和可比完整成本仍需验证。
改动思路 / Approach
两处实现导入留在既有 capability 内,不改变准入、上下文槽或 C1 的统一执行规则。当前 PR 交付完整的禁用召回加载修复;完整打包、模型采用和成本资格由原 owner 后续验证。
既有上下文 producer 仍调用配置解析:未配置时返回原 participation 包;仅 ingest 时先 reconciliation,再返回召回关闭;启用时才请求读权限 checkpoint 并执行召回。此次只将两处实现导入移入原函数,没有跳过上下文槽、修改实验资格或新增 loader/schema owner。保持现状会留下已复现的无用加载;跳过整个 producer 会改变回读和 reconciliation,因此两处局部导入是合适的最小修复。
C1 #8266 固定在 79d7ebc81fbc7fbe96f03b8b0bcbea5b79babe44,#8484 固定在 b7e4e01cc42300fb72f85c8d4c9ec3cb96b47798。触及文件的基线字节与 C1 相同,C1 组合的独立安装、执行和恢复均通过;没有改动 C1 作者分支或共享编排。
具体改动 / Changes
以改动前已接受规范 docs/architecture/rfcs/monorepo-distribution-split-v0.md、revision 4604f938b612c5da0d8a3485ce563bea922fc14e 为评审依据,当前 head 为 989c9a02436e981d26288b0549189eda819732d1。I2、I6 在本范围 implemented:单一 owner、schema/权限/公开边界不变;I3 为 out_of_scope,因为没有模块迁移或声明导出删除,仍检查 attribute/from/star 导出标识。V1、D2、D5 为 deferred:已去掉两个实际未选用实现,但完整闭包与支持组合仍需验收。V2、V3 为 deferred:受影响转移和 CLI 已回归,全量 preset/命令覆盖仍开放。V4、V5、R1 为 deferred:真实安装进程恢复通过,synthetic Host/native context 事件不证明实际模型采用。V10 为 deferred:只观测到加载和 RPC,不据带观测耗时宣称完整成本或 p95 资格。双语台账仅记录此边界,不改验收要求。
关键代码讲解
loopx/capabilities/agent_turn_recall/core.py:207的run_agent_turn_recall在实际执行时导入原 hook;原参数、guard、context/result 组装不变。它仍由 runtime 和显式 CLI 调用,模块导入不再选中执行实现。loopx/capabilities/agent_turn_recall/runtime.py:149的reward_memory_turn_read_authority_checkpoints在请求 checkpoint 时导入原读权限实现,verified、surface、registry 来源与身份验证不变。配置资格、ingest 先行、禁用返回和 receipt 去重仍由原run_configured_agent_turn_recall负责。tests/test_core_distribution.py:79的_command保持-I安装来源隔离,在真实 Turn 和 replay 后加入禁用加载断言;两个 loading 用例还检查未配置与明确关闭。复用既有导出和 Core 套件,没有新增永久 pipeline。
对主干的风险 / Risks
最强反例是 helper 测试通过,但完整 Turn 从另一路径仍加载执行实现,或 active/仅 ingest 被静默跳过。实际安装 File/SQLite CLI 的同一加载断言在基线上 2 FAIL,主干修复与 C1 组合各 2 PASS;原 artifact 独立验证、一次扣额和 replay 断言保留。四种安装组合各 38 PASS,capability/权限/provider/outcome lifecycle 共 169 PASS。另以同一 fixture 比较四种安装的六条 active、错误 peer、过期、provider 故障和仅 ingest 路径,完整返回包和调用次数一致;仅 ingest 的执行先 reconciliation 一次,preview 不执行它。
完整 disabled journal 仅规范化 JSON 对象键顺序,所有字段值相同,摘要为 76974994148a33aa80f04dc1fbe50b0d7151ce0c9cc68479e68bcd7e3b21f52f。首次 Turn 模块从 516/102 变为 514/100,RPC 仍为 File 223、SQLite 222;replay 仍为 432/50 模块、12 RPC。Node 四次启动分别是两次版本探测和两条受观测 runtime/Host bridge,不把缺少版本 probe 的 import 日志当作完整成本收益。
Ruff 与精确头 premerge 通过:6 个直接检查、14 个选中检查,0 failure/hold。首轮语义 smoke 失败记录保留;安装锁定验证依赖后,不改代码/断言/预算,完整精确头门禁通过。hosted CI 保存的观察仍有 queued/skipped,原因未判定,单独由 merge-readiness 处理。未声明的外部导入别名访问未作兼容承诺,仓内查询无此调用;已声明导出对象、checkpoint 故障恢复和权限拒绝有直接回归。
我的整体评价 / Verdict
未发现阻塞问题,APPROVE。这是 justified_increment:实际调用边界变小,维持既有 capability 与 C1 owner;production 仅两处导入移动,配套验证保护真实入口,额外 loader 或竞争 schema 不值得加入。long_horizon=preserved,user_experience=preserved:执行、中断恢复、原身份、结果回读和单次结算保持,授权已具备的用户不增加交互轮次。此次改动仅涉及导入、测试启动与非规范性 RFC 台账,没有可渲染页面或首屏变化。visual_review=not_applicable,unverified_scope:无;本改动未涉及可渲染页面。完整打包闭包、真实 Host/模型上下文、渐进控制、完整成本和 C1 默认切换继续保持未验证;这些限制不能用测试或合入数量代替。
English verdict: APPROVE — head 989c9a0; no blocking finding. The two deferred imports preserve the existing recall/authority contract; 169 regression cases, four independent 38-case Core suites, paired full packets, real CLI sensitivity and premerge passed. Model adoption/full cost remain unqualified; CI/readiness and merge authority are separate.
A Core Turn with recall disabled still imported the recall execution hook and read-authority implementation. Defer those imports inside the existing recall/checkpoint functions, preserving experiment checks, ingest reconciliation and the exported APIs. This stays within the recall capability and uses the existing C1 composition.
Validation:
79d7ebc81fbc) and C1 plus repair: 38 cases each, with source and installed bytes verified. The Host and native context events are synthetic fixtures.Four standalone installed variants also return identical complete packets and call counts for six paired recall/authority/provider-failure/ingest-only cases.
Before merge, C1 #8266 advanced to
826c6efa62ad326a34d80cba5ce40f712986afa2. Its 13-file delta was inspected; both touched recall owners retain the same baseline bytes. New standalone Core artifacts for that C1 and C1 plus this repair have verified source/installed bytes and pass the complete Core/context qualification: baseline 39 cases, combination 38 shared cases plus the additional C1 SSH settlement case. Both also preserve all six complete recall API packet/call-count observations. The combined real CLI loading oracle passes. The existing review remains on this unchanged PR head; earlier pinned evidence is retained.